import {reqCategory,reqGoods} from '@/api'

const state = {
  categoryList:[]
}
const mutations = {
  GETCATEGORY(state,categoryList){
    state.categoryList = categoryList
  }
}
const actions = {
  async getCategory({commit}){
    let res =await reqCategory()
    if (res.code == 200){
      commit('GETCATEGORY',res.data)
    }else{
    }
  },
  async textcate({commit}){
    let res =await reqGoods()
    if (res.code == 200){
      commit('GETCATEGORY',res.data)
    }else{
    }
  }
  
}

export default{
  state,
  mutations,
  actions
}